package com.lngsyz.eseal.base.enumeration;

import org.apache.commons.lang.StringUtils;

/**   
 *
 * @author: 朱志红
 * @date: 2019年5月7日 
 * @version: 1.0
 */

public enum SealStatus {
	NEW("录入中", "0"),
	PERMIT("已备案", "1"),
	ACCEPT("待制作", "2"),
	MAKE("已制作", "3"),
	DELIVERY("已交付", "4"),
	FAILED("已报废", "5"),
	HANDSUP("已缴销", "6"),
	STOLE("已挂失", "7"),
	CANCEL("已撤销", "E"),
	INVALID("无效", "F")
	;

	private String name;
	private String key;

	private SealStatus(String name, String key) {
		this.name = name;
		this.key = key;
	}

	public static String getNameByKey(String key) {
		if(StringUtils.isNotBlank(key)) {
			for (SealStatus state : SealStatus.values()) {
				if (state.getKey().equalsIgnoreCase(key)) {
					return state.getName();
				}
			}
		}
		return "";
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}
}
